package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据套餐查询关联的菜品
     * @param setmealId
     * @return
     */
    @Select("select * from sky_take_out.setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

    /**
     * 根据套餐id删除菜品
     * @param setmealId
     */
    void deleteBySetmealId(Long setmealId);

    /**
     * 批量动态添加套餐所关联的菜品
     * @param setmealDishList
     */
    void insertBatch(List<SetmealDish> setmealDishList);

    /**
     * 批量删除套餐关联的菜品
     * @param ids
     */
    void deleteBatchBySetmealId(List<Long> ids);

    /**
     * 根据菜品id动态查找
     * @param ids
     * @return
     */
    List<SetmealDish> getByDishIds(List<Long> ids);
}
